<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http：//www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<script type="text/javascript">
			$(function(){
        		$(".my97-date").click(function(){
        			WdatePicker();
        		});
        		$(".my97-datetime-h").click(function(){
        			WdatePicker({dateFmt:"yyyy-MM-dd HH:00:00"});
        		});
        	});
		</script>
	</head>
	<body>
		<form id="formTab1">
			<fieldset>
				<legend>
					患者信息
				</legend>
				<script type="text/javascript">
				$(function(){
					$("#AAA40").blur(function(){
						$(this).numberbox('fix');
						var val = $(this).val();
						if(val){
							var days = parseInt(val);
							if(!isNaN(days)&&days>=1&&days<=28){
								$("#AAA42").numberbox({required:true});
							}else{
								$("#AAA42").numberbox({required:false});
							}
						}else{
							$("#AAA42").numberbox({required:false});
						}
						$("#AAA42").numberbox("validate");
					});
					//自动计算年龄
					function generateAge(birth, enterDate){
						if(birth&&enterDate){
							birth = $D(birth);
							enterDate = $D(enterDate);
							var age = getAge(birth, enterDate);
							$("#AAA04").val(age);
						}else{
							$("#AAA04").val("");
						}
					}
					$("#AAA03,#AAB01").blur(function(){
						var birth = $("#AAA03").val();
						var enterDate = $("#AAB01").val();
						generateAge(birth, enterDate);
					});
				});
				</script>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="AAA28">病案号：</label></td>
							<td>
							<input id="AAA28" name="AAA28" type="text" class="easyui-validatebox" required="true" validType="length[1,20]" />
							</td>
							<td align="right"><label for="AAA01">姓名：</label></td>
							<td>
							<input id="AAA01" name="AAA01" type="text" class="easyui-validatebox" required="true" validType="length[1,50]"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA02C">性别代码：</label></td>
							<td>
							<input id="AAA02C" name="AAA02C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-sex.json" panelHeight="auto" required="true" validType="comboboxfixed['AAA02C']"/>
							</td>
							<td align="right"><label for="AAA03">出生日期：</label></td>
							<td>
							<input id="AAA03" name="AAA03" type="text" class="easyui-validatebox my97-date" required="true"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA04">年龄：</label></td>
							<td>
							<input id="AAA04" name="AAA04" type="text" class="easyui-numberbox" min="0" max="999" disabled="true"/>
							</td>
							<td align="right"><label for="AAA05C">国籍代码：</label></td>
							<td>
							<input id="AAA05C" name="AAA05C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-country.json" panelHeight="auto" validType="comboboxfixed['AAA05C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA40">年龄不足1周岁天数：</label></td>
							<td>
							<input id="AAA40" name="AAA40" type="text" class="easyui-numberbox" min="1" max="365"/>
							</td>
							<td align="right"><label for="AAA42">新生儿入院体重(克)：</label></td>
							<td>
							<input id="AAA42" name="AAA42" type="text" class="easyui-numberbox" min="1" max="9999"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA06C">民族代码：</label></td>
							<td>
							<input id="AAA06C" name="AAA06C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-nation.json" validType="comboboxfixed['AAA06C']"/>
							</td>
							<td align="right"><label for="AAA07">身份证号：</label></td>
							<td>
							<input id="AAA07" name="AAA07" type="text" class="easyui-validatebox" validType="length[18,18]"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA08C">婚姻状况代码：</label></td>
							<td>
							<input id="AAA08C" name="AAA08C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-marital-status.json" panelHeight="auto" required="true" validType="comboboxfixed['AAA08C']"/>
							</td>
							<td align="right"><label for="AAA16C">现住址区县编码（居住半年以上）：</label></td>
							<td>
							<input id="AAA16C" name="AAA16C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-area.json" required="true" validType="comboboxfixed['AAA16C']"/>
							</td>
						</tr>
					<!-- 
					</tbody>
				</table>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
					-->
						<tr>
							<td align="right"><label for="AAA18C">职业代码：</label></td>
							<td>
							<input id="AAA18C" name="AAA18C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-profession.json" required="true" validType="comboboxfixed['AAA18C']"/>
							</td>
							<td></td><td></td>
						</tr>
						<tr>
							<td align="right"><label for="AAA19">工作单位及地址：</label></td>
							<td colspan="3">
							<input id="AAA19" name="AAA19" type="text" class="easyui-validatebox longtext" validType="length[0,200]" />
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA20">工作单位电话：</label></td>
							<td>
							<input id="AAA20" name="AAA20" type="text" class="easyui-validatebox" validType="length[0,20]"/>
							</td>
							<td align="right"><label for="AAA21C">工作单位邮政编码：</label></td>
							<td>
							<input id="AAA21C" name="AAA21C" type="text" class="easyui-numberbox" min="100000" max="999999"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA22">联系人姓名：</label></td>
							<td>
							<input id="AAA22" name="AAA22" type="text" class="easyui-validatebox" validType="length[0,20]"/>
							</td>
							<td align="right"><label for="AAA23C">联系人关系代码：</label></td>
							<td>
							<input id="AAA23C" name="AAA23C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-relationship.json" validType="comboboxfixed['AAA23C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA24">联系人地址：</label></td>
							<td colspan="3">
							<input id="AAA24" name="AAA24" type="text" class="easyui-validatebox longtext"  validType="length[0,200]"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA25">联系人电话：</label></td>
							<td>
							<input id="AAA25" name="AAA25" type="text" class="easyui-validatebox" validType="length[0,20]"/>
							</td>
							<td align="right"><label for="AAA26C">医疗付费方式代码：</label></td>
							<td>
							<input id="AAA26C" name="AAA26C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-payment-method.json" required="true" validType="comboboxfixed['AAA26C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAA27">医疗保险手册(卡)号(健康卡号)：</label></td>
							<td>
							<input id="AAA27" name="AAA27" type="text" class="easyui-validatebox" validType="length[0,40]"/>
							</td>
							<td align="right"><label for="AAA29">住院次数：</label></td>
							<td>
							<input id="AAA29" name="AAA29" type="text" class="easyui-numberbox" min="1" max="9999" required="true"/>
							</td>							
						</tr>
					</tbody>
				</table>
				<div class="easyui-panel" title="展开这里，填写更多地址信息" collapsible="true" collapsed="true">
					<script type="text/javascript">
					function addressFilter(q,row){
						return (row["text"].indexOf(q)>=0)||(row["pym"].toUpperCase().indexOf(q.toUpperCase())>=0);
					}
					//formatter: addressFormatter
					function addressFormatter(row){
						return row.text+row.pym;
					}
					$(function(){
						$("#AAA09").combobox({
							valueField:"text",
							data:address,
							filter: addressFilter,
							box:$.extend({},$.fn.combobox.defaults.box,{
								onblur:function(){
									var value = $(this).combobox("getValue");
									if(value){
										var data = $(this).combobox("getData");							
										for(var i=0;i<data.length;i++){
											if(data[i]["text"]==value){
												$("#AAA10").combobox("loadData",data[i].children||[]);
												$("#AAA11").combobox("loadData",[]);
												return;
											}
										}
									}
									$("#AAA10").combobox("loadData",[]);
									$("#AAA11").combobox("loadData",[]);
								}
							})
							//onSelect: function(record){
							//	$("#AAA10").combobox("loadData",record.children||[]);
							//	$("#AAA11").combobox("loadData",[]);
							//}
						});
						$("#AAA10").combobox({
							valueField:"text",
							filter: addressFilter,
							box:$.extend({},$.fn.combobox.defaults.box,{
								onblur:function(){
									var value = $(this).combobox("getValue");
									if(value){
										var data = $(this).combobox("getData");							
										for(var i=0;i<data.length;i++){
											if(data[i]["text"]==value){
												$("#AAA11").combobox("loadData",data[i].children||[]);
												return;
											}
										}
									}
									$("#AAA11").combobox("loadData",[]);
								}
							})
							//onSelect: function(record){
							//	//$("#AAA11").combobox("clear");
							//	$("#AAA11").combobox("loadData",record.children||[]);
							//}
						});
						$("#AAA11").combobox({
							valueField:"text",
							filter: addressFilter
						});
					});					
					</script>
					<fieldset>
						<legend>出生地</legend>
						<table class="layout-table">
							<colgroup>
								<col width="13%"/>
								<col width="87%"/>
							</colgroup>
							<tr>
								<td align="right"><label for="AAA09">出生地：</label></td>
								<td>
								<input style="width:200px;" id="AAA09" name="AAA09" type="text" validType="comboboxfixed['AAA09']"/>
								省（区、市）
								<input style="width:200px;" id="AAA10" name="AAA10" type="text" class="easyui-combobox" validType="comboboxfixed['AAA10']"/>
								市
								<input style="width:200px;" id="AAA11" name="AAA11" type="text" class="easyui-combobox" validType="comboboxfixed['AAA11']"/>
								县
								</td>
							</tr>
						</table>
					</fieldset>
					<script type="text/javascript">
					$(function(){
						$("#AAA43").combobox({
							valueField:"text",
							data:address,
							filter: addressFilter,
							box:$.extend({},$.fn.combobox.defaults.box,{
								onblur:function(){
									var value = $(this).combobox("getValue");
									if(value){
										var data = $(this).combobox("getData");							
										for(var i=0;i<data.length;i++){
											if(data[i]["text"]==value){
												$("#AAA44").combobox("loadData",data[i].children||[]);
												return;
											}
										}
									}
									$("#AAA44").combobox("loadData",[]);
								}
							})
						});
						$("#AAA44").combobox({
							valueField:"text",
							filter: addressFilter
						});
					});					
					</script>
					<fieldset>
						<legend>籍贯</legend>
						<table class="layout-table">
							<colgroup>
								<col width="13%"/>
								<col width="87%"/>
							</colgroup>
							<tr>
								<td align="right"><label for="AAA43">籍贯：</label></td>
								<td>
								<input style="width:200px;" id="AAA43" name="AAA43" type="text" class="easyui-combobox" validType="comboboxfixed['AAA43']"/>
								省（区、市）
								<input style="width:200px;" id="AAA44" name="AAA44" type="text" class="easyui-combobox" validType="comboboxfixed['AAA44']"/>
								市
								</td>
							</tr>							
						</table>
					</fieldset>
					<script type="text/javascript">
					$(function(){
               			$("input.autocomplete_streat_code").autocomplete(Dic_Streat, {
                   			//mustMatch: true,
                   			autoFill: false,
							matchContains: true,
                   			formatItem: function(item){
                   				return item.code+"-"+item.name;
                 			},
							formatResult: function(data) {
								return data.code;
							}
              			});
               			$("#AAA45").combobox({
							valueField:"text",
							data:address,
							filter: addressFilter,
							box:$.extend({},$.fn.combobox.defaults.box,{
								onblur:function(){
									var value = $(this).combobox("getValue");
									if(value){
										var data = $(this).combobox("getData");							
										for(var i=0;i<data.length;i++){
											if(data[i]["text"]==value){
												$("#AAA46").combobox("loadData",data[i].children||[]);
												$("#AAA47").combobox("loadData",[]);
												return;
											}
										}
									}
									$("#AAA46").combobox("loadData",[]);
									$("#AAA47").combobox("loadData",[]);
								}
							})
						});
						$("#AAA46").combobox({
							valueField:"text",
							filter: addressFilter,
							box:$.extend({},$.fn.combobox.defaults.box,{
								onblur:function(){
									var value = $(this).combobox("getValue");
									if(value){
										var data = $(this).combobox("getData");							
										for(var i=0;i<data.length;i++){
											if(data[i]["text"]==value){
												$("#AAA47").combobox("loadData",data[i].children||[]);
												return;
											}
										}
									}
									$("#AAA47").combobox("loadData",[]);
								}
							})
						});
						$("#AAA47").combobox({
							valueField:"text",
							filter: addressFilter
						});
            		});
					</script>
					<fieldset>
						<legend>户籍地址</legend>
						<table class="layout-table">
							<colgroup>
								<col width="13%"/>
								<col width="20%"/>
								<col width="13%"/>
								<col width="20%"/>
								<col width="13%"/>
								<col width="20%"/>
							</colgroup>
							<tr>
								<td align="right"><label for="AAA45">户籍地址：</label></td>
								<td colspan="5">
								<input style="width:200px;" id="AAA45" name="AAA45" type="text" class="easyui-combobox" validType="comboboxfixed['AAA45']"/>
								省（区、市）
								<input style="width:200px;" id="AAA46" name="AAA46" type="text" class="easyui-combobox" validType="comboboxfixed['AAA46']"/>
								市
								<input style="width:200px;" id="AAA47" name="AAA47" type="text" class="easyui-combobox" validType="comboboxfixed['AAA47']"/>
								县
								</td>
							</tr>
							<tr>
								<td align="right"><label for="AAA13C">区县编码：</label></td>
								<td>
								<input style="width:200px;" id="AAA13C" name="AAA13C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-area.json" validType="comboboxfixed['AAA13C']"/>
								</td>
								<td align="right"><label for="AAA33C">街道乡镇代码：</label></td>
								<td>
								<input style="width:200px;" id="AAA33C" name="AAA33C" class="easyui-validatebox autocomplete_streat_code" type="text" validType="fixedin[Dic_Streat,'code']"/>
								</td>
								<td align="right"><label for="AAA14C">邮政编码：</label></td>
								<td>
								<input style="width:200px;" id="AAA14C" name="AAA14C" type="text" class="easyui-numberbox" min="100000" max="999999"/>
								</td>
							</tr>
						</table>
					</fieldset>
					<fieldset>
						<legend>现住址（居住半年以上）</legend>
						<table class="layout-table">
							<colgroup>
								<col width="13%"/>
								<col width="20%"/>
								<col width="13%"/>
								<col width="20%"/>
								<col width="13%"/>
								<col width="20%"/>
							</colgroup>
							<tr>
								<td align="right"><label for="AAA48">现住址（居住半年以上）：</label></td>
								<td colspan="5">
								<input style="width:200px;" id="AAA48" name="AAA48" type="text" class="easyui-validatebox" validType="length[0,50]"/>
								省（区、市）
								<input style="width:200px;" id="AAA49" name="AAA49" type="text" class="easyui-validatebox" validType="length[0,50]"/>
								市
								<input style="width:200px;" id="AAA50" name="AAA50" type="text" class="easyui-validatebox" validType="length[0,50]"/>
								县
								</td>
							</tr>
							<tr>							
								<td align="right"><label for="AAA36C">街道乡镇代码：</label></td>
								<td>
								<input style="width:200px;" id="AAA36C" name="AAA36C" type="text" class="easyui-validatebox autocomplete_streat_code" validType="fixedin[Dic_Streat,'code']"/>
								</td>
								<td align="right"><label for="AAA51">电话：</label></td>
								<td>
								<input style="width:200px;" id="AAA51" name="AAA51" type="text" class="easyui-validatebox" validType="length[0,20]"/>
								</td>
								<td align="right"><label for="AAA17C">邮政编码：</label></td>
								<td>
								<input style="width:200px;" id="AAA17C" name="AAA17C" type="text" class="easyui-numberbox" min="100000" max="999999"/>
								</td>
							</tr>
						</table>
					</fieldset>
				</div>
			</fieldset>
			<script type="text/javascript">
			$(function(){
				$("#AAB01,#AAC01").blur(function(){
					if($("#AAB01").validatebox("isValid")&&$("#AAC01").validatebox("isValid")){
						var enterTime = $("#AAB01").val();
						var outTime = $("#AAC01").val();
						if(enterTime&&outTime){
							enterDate = $D(enterTime.split(" ")[0]);
							outDate = $D(outTime.split(" ")[0]);
							if(enterDate&&outDate){
								var days = (outDate.getTime()-enterDate.getTime())/(24*3600*1000);
								if(days<0){
									$("#AAC04").val("");
								}else if(days==0){
									$("#AAC04").val(1);
								}else{
									$("#AAC04").val(Math.ceil(days));
								}
								$("#AAC04").validatebox("validate");
							}
						}
					}
				});
			});
			</script>
			<fieldset>
				<legend>
					入院信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="AAB01">入院时间（时）：</label></td>
							<td>
							<input id="AAB01" name="AAB01" type="text" class="easyui-validatebox my97-datetime-h" required="true" validType="datebefore['#AAC01','出院时间']"/>
							</td>
							<td align="right"><label for="AAB02C">入院科别代码：</label></td>
							<td>
							<input id="AAB02C" name="AAB02C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-medical-subject.json" required="true" validType="comboboxfixed['AAB02C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAB03">入院病房：</label></td>
							<td>
							<input id="AAB03" name="AAB03" type="text" class="easyui-validatebox" validType="length[0,20]"/>
							</td>
							<td align="right"><label for="AAB06C">入院途径：</label></td>
							<td>
							<input id="AAB06C" name="AAB06C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-RuYuanTuJing.json" panelHeight="auto" required="true" validType="comboboxfixed['AAB06C']"/>
							</td>
						</tr>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>
					出院信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tbody>
						<tr>
							<td align="right"><label for="AAC01">出院时间（时）：</label></td>
							<td>
							<input id="AAC01" name="AAC01" type="text" class="easyui-validatebox my97-datetime-h" required="true" validType="dateafter['#AAB01','入院时间']"/>
							</td>
							<td align="right"><label for="AAC02C">出院科别代码：</label></td>
							<td>
							<input id="AAC02C" name="AAC02C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-medical-subject.json" required="true" validType="comboboxfixed['AAC02C']"/>
							</td>
						</tr>
						<tr>
							<td align="right"><label for="AAC03">出院病房：</label></td>
							<td>
							<input id="AAC03" name="AAC03" type="text" class="easyui-validatebox"  validType="length[0,20]"/>
							</td>
							<td align="right"><label for="AAC04">实际住院(天)：</label></td>
							<td>
							<input id="AAC04" name="AAC04" type="text" class="easyui-numberbox" min="1" max="999999" required="true" disabled="true" />
							</td>
						</tr>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>
					转经信息
				</legend>
				<table class="layout-table">
					<tbody>
						<tr>
							<td align="right" style="width: 20%"><label for="AAD01C">转经科别代码：</label></td>
							<td style="width: 80%">
							<input id="AAD01C" name="AAD01C" type="text" class="easyui-combobox" url="medicalrecord/data/dic-medical-subject.json" multiple="true" style="width: 600px" validType="comboboxfixed['AAD01C']"/>
							</td>
						</tr>
					</tbody>
				</table>
			</fieldset>
			<fieldset>
				<legend>
					医师信息
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tr>
						<td align="right"><label for="AEE01"> 科主任姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE01" name="AEE01" validType="length[1,20]"/>
						</td>
						<td align="right"><label for="AEE02"> 主(副主)任医师姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE02" name="AEE02" required="true" validType="length[1,20]"/>
						</td>
					</tr>
					<tr>
						<td align="right"><label for="AEE03"> 主治医师姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE03" name="AEE03" required="true" validType="length[1,20]"/>
						</td>
						<td align="right"><label for="AEE11"> 主诊医师执业证书编码: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE11" name="AEE11" validType="length[1,16]"/>
						</td>
					</tr>
					<tr>
						<td align="right"><label for="AEE09"> 主诊医师姓名（主管医师姓名）: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE09" name="AEE09" validType="length[1,20]"/>
						</td>
						<td align="right"><label for="AEE04"> 住院医师姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE04" name="AEE04" validType="length[1,20]"/>
						</td>
					</tr>
					<tr>
						<td align="right"><label for="AEE05"> 进修医师姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE05" name="AEE05" validType="length[1,20]"/>
						</td>
						<td align="right"><label for="AEE07"> 实习医师姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE07" name="AEE07" validType="length[1,20]"/>
						</td>
					</tr>
					<tr>
						<td align="right"><label for="AEE08"> 编码员姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE08" name="AEE08" validType="length[1,20]"/>
						</td>
						<td align="right"><label for="AEE10"> 责任护士姓名: </label></td>
						<td>
						<input class="easyui-validatebox" type="text" id="AEE10" name="AEE10" validType="length[1,20]"/>
						</td>
					</tr>
				</table>
			</fieldset>
		</form>
	</body>
</html>
